import logging
import os
from .utils.permissions import PermissionManager

# 配置日志
logging.basicConfig(
    level=logging.INFO,
    format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
    handlers=[
        logging.StreamHandler(),  # 输出到控制台
        logging.FileHandler('ws_notifier.log')  # 输出到文件
    ]
)

__version__ = '0.1.0'

from .gui.tray import SystemTray
from .config import Config

def main():
    try:
        # 检查通知权限
        if not PermissionManager.check_notification_permissions():
            logger.warning("Starting without notification permissions")
            
        config = Config()
        tray = SystemTray(config)
        tray.run()
    except Exception as e:
        logging.error(f"Application error: {e}")
        raise

if __name__ == "__main__":
    main() 